<template>
  <div>
    <Header></Header>
    <div class="main">
      <div class="ys-search-search">
        <div class="ys-body-search">
          <input type="text" placeholder="请输入搜索的内容" v-model="keyword">
        </div>
        <el-row class="mb-4" id="regBtn">
          <el-button type="primary" id="searchBtn" @click="searchShop">搜索</el-button>
        </el-row>
      </div>

      <div class="ys-search-list-introduction">
        <h5>所有分类></h5>
        <div class="ys-search-list-introduction-main">
          <div class="ys-search-list-introduction-classification">品牌:</div>
          <div class="ys-search-list-introduction-classification">适用季节:</div>
          <div class="ys-search-list-introduction-classification">尺码:</div>
        </div>
      </div>
      <div class="ys-search-list-search-choice">
        <div class="ys-search-list-sort">综合排序</div>
        <div class="ys-search-list-sort">销量</div>
        <div class="ys-search-list-sort">信用</div>
        <div class="ys-search-list-sort">价格</div>
      </div>
      <div class="ys-search-shop-list">
        <ul class="ys-search-shop-list-main">
          <li v-for="(c,index) in this.orders" :key="index">
            <a href=""></a>
            <img class="shops-img" :src="this.getUrl(c.imgs[0].url)"/>
            <a id="des-of-shops" href="#" @click="toIntroductionShop">{{c.content}}</a>
            <p id="des-of-price">￥{{}}元</p>
            <p id="des-of-salve-volume">销量{{ c.soldNum }}</p>
          </li>

        </ul>
      </div>
      <div class="ys-search-list-bottom">—— END ——</div>
    </div>
    <LoginFooter></LoginFooter>
  </div>
</template>

<script>
import Header from "../components/Header";
import LoginFooter from "../components/LoginFooter";
// import {Search} from "@element-plus/icons-vue";
import {publicFun} from "../mixin";

export default {
  name: "search",
  components: {
    Header, LoginFooter
  },
  data() {
    return {
      keyword: "",
      pageNum: 1,
      limit: 20,
      orders:null,
      imgsurl:""
    }
  },
  methods: {
    searchShop() {
      this.$axios.get("api/productTui/searchProductByKeyword",{
        params:{
          keyword:this.keyword,
          limit:this.limit,
          pageNum:this.pageNum
        }
      }).then((res)=>{
        console.log(res)
        if(res.data.code == 201)
        {
          this.orders=res.data.data.list
        }
      })

    },
    getUrl(name) {
      return require("../assets/img/" + name + ".jpg");
    },
  },
  mixins: [publicFun],
  updated() {
  }
}
</script>

<style scoped>
.main {
  box-sizing: border-box;
  width: auto;
  height: auto;
  background-color: white;
}

.ys-search-search {
  width: 1190px;
  height: 100px;
  /*border: 1px solid black;*/
  background-color: white;
}

.ys-search-list-introduction {
  width: 1190px;
  height: 180px;
  border: 1px solid rgba(201, 201, 201, 0.51);
  background-color: white;
}

.ys-search-list-introduction > h5 {
  margin-left: 10px;
  font-weight: 400;
  color: rgba(155, 155, 155, 0.99);
}

.ys-search-list-introduction-main {
  /*margin-top: 5px;*/
  width: 1190px;
  height: 280px;
  background-color: white;
}

.ys-search-list-search-choice {
  margin-top: 15px;
  width: 1190px;
  height: 40px;
  border: 1px solid rgba(201, 201, 201, 0.51);
  background-color: rgba(218, 218, 218, 0.11);

}

.ys-search-list-sort {
  float: left;
  width: 100px;
  height: 40px;
  /*border: 1px solid black;*/
  line-height: 38px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
}

.ys-search-list-sort:hover {
  color: #01ccb3;
  background-color: white;
}

.ys-search-shop-list {
  margin-top: 15px;
  width: 1190px;
  background-color: rgba(3, 231, 203, 0.15);
  /*height: 1000px;*/
  overflow: hidden;
}

.ys-search-shop-list-main {
  display: block;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ys-search-shop-list-main > li {
  display: block;
  height: 280px;
  float: left;
  width: 200px;
  border: 1px solid rgba(201, 201, 201, 0.51);
  margin-left: 30px;
  margin-top: 30px;
  background-color: white;
  border-radius: 10px;
}

.ys-search-shop-list-main > li:hover {
  border: 1px solid #01ccb3;
}

.shops-img {
  width: 200px;
  height: 180px;
  /*border: 1px solid black;*/
  margin-top: 10px;
}

#des-of-shops {
  margin-left: 10px;
  font-size: 15px;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.6);
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  width: 180px;
  overflow: hidden;
}

#des-of-shops:hover {
  color: #01ccb3;
}

#des-of-price {
  margin-left: 10px;
  font-size: 20px;
  margin-top: 30px;
  color: #01ccb3;
  background-image: -webkit-linear-gradient(bottom, rgb(53, 144, 176), rgba(11, 255, 52, 0.59));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ys-search-list-bottom {
  width: 1190px;
  height: 80px;
  background-color: rgba(3, 231, 203, 0.15);
  border-radius: 0 0 20px 20px;
  color: rgba(114, 112, 112, 0.24);
  text-align: center;
  line-height: 80px;
  font-size: 30px;
  font-family: "Microsoft Himalaya";
}

#des-of-salve-volume {
  /*position: absolute;*/
  margin-left: 120px;
  margin-top: -22px;
}

.ys-search-list-introduction-classification {
  width: 1180px;
  height: 53px;
  margin-top: 1px;
  /*border: 1px solid black;*/
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px dashed rgba(201, 201, 201, 0.51);
  color: rgba(155, 155, 155, 0.99);
  font-size: 12px;
  font-family: 新宋体;
  box-sizing: border-box;
  padding: 16px;
}

.ys-body-search {
  display: inline-block;
  width: 600px;
  height: 40px;
  border: 1px solid rgba(171, 171, 171, 0.49);
  position: absolute;
  margin-left: 300px;
  margin-top: 30px;
  border-radius: 20px 0 0 20px;
}

.ys-body-search > input {
  display: inline-block;
  height: 40px;
  width: 550px;
  margin-left: 46px;
  margin-top: 0;
  border: none;
  outline: 0 none !important;
}

#searchBtn {
  position: absolute;
  margin-left: 901px;
  margin-top: 30px;
  height: 42px;
  border-radius: 0px 20px 20px 0;
  border: none;
  background-color: rgba(48, 184, 189, 0.7);
  transition-property: background-color, color;
  transition-duration: 500ms, 500ms;
}

#searchBtn:hover {
  background-color: #0075bd;
  color: white;
  border: none;
}
</style>